﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using King.Engine.Core;
using King.Engine.GameObjects.Hud.Menu;
using Microsoft.Xna.Framework;

namespace BreacherCreature
{
    public class MenuActivity : Activity
    {

        #region Fields

        private Menu _menu;

        #endregion


        #region Constants

        #endregion


        #region Protected Methods

        protected override void OnStart()
        {

            MenuTree tree = new MenuTree("Main Menu")
            {
                {"Play", Play},
                {"Quit", Quit}
            };

            MenuLayout layout = new MenuLayout()
            {
                TitleColor = Color.Red,
                ItemColor = Color.White,
                SelectedItemColor = Color.Yellow,
                TitleLocation = new Vector2(10, 10),
                FirstItemLocation = new Vector2(50, 40),
                ItemSeparation = new Vector2(0, 20)
            };

            _menu = new Menu(tree, DrawDepths.HUD, "HUD_MSG_FONT", layout);

            AddGameObject(_menu);
        }

        protected override void OnResume()
        {
            Screen.CameraWidth = Screen.WindowWidth = 1280;
            Screen.CameraHeight = Screen.WindowHeight = 720;
        }

        #endregion


        #region

        private void Play()
        {
            ActivityManager.SetActivity<GameActivity>();
        }

        private void Quit()
        {
            King.Engine.Core.Game.ExitGame();
        }

        #endregion

    }
}
